forum

Home / DeveloperSection / Forums / Using %string% instead of {{string}} in a RegEx

Using %string% instead of {{string}} in a RegEx

Anonymous User 2826 28-Sep-2013

To translate some strings in my HTML, I'm using the following function which is working totally fine to replace every string coming in double curly braces:

var translation = html.replace(/\{[^\}]*\}/g, function(match){

    // where the magic happens
});


How can I change the RegEx to match the pattern %string% instead of {{string}}?


Updated on 28-Sep-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By